package com.qk.mapper;

import com.qk.entity.Course;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CourseMapper {
    List<Course> selectlist(String name, Integer subject, Integer target);

    //根据id来删除课程
    @Delete("delete from course where id = #{id}")
    void deleteById(Integer id);

@Insert("insert into course(name,subject,price,target,description,create_time,update_time) values(#{name},#{subject},#{price},#{target},#{description},#{createTime},#{updateTime})")
    void add(Course course);
@Select("select id, name, subject, price, target, description, create_time, update_time from course where id= #{id}")
    Course selectById(Integer id);

    void update(Course course);

    List<Course> selectAllNormal();

    List<Course> listBySubject(int i);
}
